function toPoint() {
    window.history.back(-1);
}

function pointAdd(){
    var devCode = document.getElementById("devCode").value;
    var pointName = document.getElementById("pointName").value;
    if(devCode==""){
        window.parent.layerAlert('点位代码不能为空', {
            icon: 5,
            title: "提示"
        });
        return false;
    }
    if(pointName==""){
        window.parent.layerAlert('点位名称不能为空', {
            icon: 5,
            title: "提示"
        });
        return false;
    }
    $.ajax({
        type: "GET",
        url: "/multipower/point/add",
        data: {
            devCode:devCode,
            pointName:pointName,
        },
        success: function (data) {
            if(data.status==1){
                window.location.href = "/multipower/point.html";
                window.parent.layerAlert("添加成功", {
                    icon: 6,
                    title: "提示"
                });
            }else{
                window.parent.layerAlert(data.msg, {
                    icon: 6,
                    title: "提示"
                });
            }
        },
        error:function () {
            window.parent.layerAlert("添加失败", {
                icon: 5,
                title: "提示"
            });
            return false;
        }
    })
}